<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button type="button"onclick="testGet()" >GET</button>
		<div id="content">
			  <h3 id="title"></h3>
			  <div id="image">
			  	
			  </div>
			   <p id="time"></p>
		</div>
	</body>
	<script type="text/javascript">
		function testGet(){
			var ajax = new XMLHttpRequest();
			ajax.open('GET','https://api.apiopen.top/getWangYiNews')
			ajax.send()
			ajax.onreadystatechange = function(){
				if(ajax.readyState==4 && ajax.status==200){
					var obj = JSON.parse(ajax.responseText)
					if(obj.code == 200&&obj.message=="成功!"){
						
						document.getElementById('title').innerHTML=obj.result[0].title;
						document.getElementById('image').innerHTML=obj.result[0].image;
						document.getElementById('time').innerHTML=obj.result[0].passtime;
						console.log(obj.result)
					}
				}
			}			
		}
	</script>
</html>
